<#include "/common/header.html" >
<body class="gray-bg">
    <div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox">
                    <div class="ibox-content">
                       <div class="row m-b">
                    		<div class="col-sm-5">
                    			<a href="/sys/goods/add" class="btn btn-m btn-primary">添加商品</a>
                    			<a href="" class="btn btn-m btn-danger btn-outline">删除</a>
                    		</div>
                           <form action="/sys/goods/listsolr" class="form-horizontal" id="searchForm">
                              	<label class="col-sm-1 control-label">分类:</label>
                                <div class="col-sm-2 m-b-xs">
	                                <select class="form-control input-m" name="catePid">
	                                	<option value="0">请选择</option>
	                                	<#list cateList as cate>
	                                		<!-- <#if catePid == cate.id>
	                                			<option value="${cate.id}" selected="selected">${cate.name}</option>
	                                		<#else>
	                                			<option value="${cate.id}" >${cate.name}</option>
	                                		</#if> -->
	                                		<option value="${cate.id}" ${(catePid == cate.id)?string("selected","")} >${cate.name}</option>
	                                	</#list>
	                                </select>
                            	</div>
                            	<div class="col-sm-4">
	                                <div class="input-group">
	                                    <input type="text" placeholder="输入商品名称搜索" name="queryInput" class="input-m form-control" value="${queryInput}"> <span class="input-group-btn"> <span class="input-group-btn">
	                                        <button type="submit" class="btn btn-m btn-primary"> 搜索</button> </span>
	                                </div>
                            	</div>
                    	    </form>
                        </div>
                        <div class="clients-list">
                            <div class="full-height-scroll">
                                <div class="table-responsive">
                                    <table class="table table-striped table-hover">
                                    <tr>
                                    	<th>商品序列号</th>
                                    	<th>商品名称</th>
                                    	<th>分类名称</th>
                                    	<th>商品数量</th>
                                    	<th>商品售价</th>
                                    	<th>商品原价</th>
                                    	<th>创建时间</th>
                                    	<th>操作</th>
                                    </tr>
                                    <#list pageInfo.records as good>
	                                    <tr>
	                                    	<td>${good.goodsSn }</td>
	                                    	<td>${good.name }<br>
	                                    	${good.nameHighlighting }
	                                    	</td>
	                                    	<td>${good.categoryParentName},${good.categoryName}</td>
	                                    	<td>${good.goodsNumber }</td>
	                                    	<td>${good.retailPrice }</td>
	                                    	<td>${good.marketPrice }</td>
	                                    	<td>${good.createTime }</td>
	                                    	<td>
	                                    	 <a href="/sys/goods/get/${good.id}" class="cate-upd"><span class="label label-primary">编辑</span></a>
	                                         <a href="/sys/goods/del?id=${good.id}" class="cate-del"><span class="label label-warning">删除</span></a>
	                                    	</td>
	                                    </tr>
                                    </#list>
                                    </table>
    								<#include "/common/rollpage.html" >
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <#include "/common/footer.html" >
    <script type="text/javascript">
    $(function(){
    	$(".cate-del").click(function(){
    		var _a = $(this);
    		$.ajax({
    			url:_a.attr("href"),
    			type:"GET",
    			dataType:"JSON",
    			success:function(data){
    				wxLayer.alert(data.message,function(){
						if(data.status)
							location.href = "/sys/goods/list";
					});
    			},
    			error:function(){
    				wxLayer.alert("操作失败");
    			}
    		})
    		
    		return false;	
    	})
    })
    </script>
</body>
</html>
